Skip to content

feat: Implement stateful retry and resumable stream logic for TopicMessageQuery#2171

Merged
manishdait merged 10 commits into
hiero-ledger:mainfrom
manishdait:fix/flaky-submit-msg.e2e
Jun 2, 2026
Merged

feat: Implement stateful retry and resumable stream logic for TopicMessageQuery#2171
manishdait merged 10 commits into
hiero-ledger:mainfrom
manishdait:fix/flaky-submit-msg.e2e

Conversation

@manishdait

Copy link
Copy Markdown
Contributor

Description:
This PR introduces fixes for flaky TopicMessageQuery e2e tests by implementing retry logic and error handling.

Changes Made:

  • Added SubscriptionState to track last_message and count. on retry, the query resumes from last_message.consensusTimestamp + 1ns to prevent message loss or duplication.
  • Added _should_retry logic to identify retryable gRPC errors (e.g., UNAVAILABLE, RESOURCE_EXHAUSTED) and specific RST_STREAM internal errors.
  • Updated SubscriptionHandle to safely manage gRPC call cancellation across threads.

Related issue(s):

Fixes #1796

Notes for reviewer:

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

open to community review PR is open for community review and feedback scope: DLT involves engineering for distributed ledger technology skill: advanced requires knowledge of multiple areas in the codebase without defined steps to implement or examples status: ready-to-merge PR has 1+ maintainer and 2+ total approvals, ready to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Advanced]: Bug in tests/integration/topic_message_query_e2e_test.py

3 participants